package cn.edu.jsu.nrs.util;

import org.springframework.stereotype.Component;

@Component
public class ConvertArray {
	/**
	 * 将"12,13,2,4"这样类型的字符串分割成数组
	 * @param ids
	 * @return
	 */
	public String[] convertIdsToArray(String ids) {
		String[] deleteIds;//定义删除ids数组
		int counts=0;
		//获取id的个数
		for (int i = 0; i < ids.length(); i++) {
			if (ids.charAt(i)==',') {
				counts++;
			}
		}
		deleteIds=new String[counts];
		deleteIds=ids.split(",");
		return deleteIds;
	}

}
